@import "./var";

#app {
  // 主体区域
  .main-container {
    height: 100%;
    transition: margin-left 0.3s;
    margin-left: @sidebarWidth-lg;
    @media (max-width: 1400px) {
      margin-left: @sidebarWidth-md;
    }
  }
  // 侧边栏
  .sidebar-container {
    transition: width 0.3s;
    width: @sidebarWidth-lg !important;
    height: 100%;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1001;
    background-color: @sidebarBackgroundColor;
    @media (max-width: 1400px) {
      width: @sidebarWidth-md !important;
    }
    a {
      display: inline-block;
      width: 100%;
    }
    .icon {
      margin-right: 5px;
    }
    .el-menu {
      border: none;
      width: 100%;
    }
    .sidebar-logo {
      padding: 25px 20px;
      transition: padding .3s;
      overflow: hidden;
      width: 100%;
      display: table;
      table-layout: fixed;
      box-sizing: border-box;
      position: relative;
      z-index: 1;
      .sidebar-logo-png {
        display: table-cell;
        vertical-align: middle;
        width: 34px;
        height: 40px;
        img {
          width: 34px;
          vertical-align: middle;
        }
      }
      .sidebar-logo-title {
        display: table-cell;
        height: 40px;
        vertical-align: middle;
        padding-left: 10px;
        color: #ffffff;
        font-size: 14px;
        p {
          margin: 2px 0;
          word-wrap: break-word;
        }
      }
    }
    .sidebarItem-groupTitle {
      color: #ffffff;
      font-size: 14px;
      margin: 12px 10px;
      height: 14px;
      line-height: 14px;
      overflow: hidden;
    }
  }
  .hideSidebar {
    .sidebar-logo {
      padding: 25px 8px;
    }
    .sidebar-container {
      width: @sidebarCollapseWidth !important;
      // overflow: inherit;
    }
    .main-container {
      margin-left: @sidebarCollapseWidth;
    }
    .submenu-title-noDropdown {
      padding-left: 13px !important;
      position: relative;
      svg {
        margin-right: 25px;
      }
      span {
        overflow: hidden;
        visibility: hidden;
        transition: opacity .3s cubic-bezier(.55, 0, .1, 1);
        opacity: 0;
        display: inline-block;
      }
      &:hover {
        span {
          display: block;
          border-radius: 2px;
          z-index: 1002;
          width: @sidebarItemWidth-lg;
          visibility: visible;
          position: absolute;
          right: @sidebarTooltipRight-lg;
          text-align: left;
          text-indent: 20px;
          top: 0;
          background-color: @sidebarSubMenuBackgroundColor !important;
          opacity: 1;
          @media (max-width: 1400px) {
            width: @sidebarItemWidth-md;
            right: @sidebarTooltipRight-md;
          }
        }
      }
      &.is-active {
        span {
          color: @sidebarItemActiveColor;
        }
      }
    }
    .el-submenu {
      & > .el-submenu__title {
        padding-left: 13px !important;
        & > span {
          display: none;
        }
        .el-submenu__icon-arrow {
          opacity: 0;
          //  display: none;
        }
      }
      & > .el-menu {
        display: none;
      }
    }
    .el-menu-item, .el-submenu__title {
      margin: 2px 5px;
    }
    .sidebarItem-groupTitle {
      display: none;
    }
  }
  .el-menu-item {
    .el-tooltip {
      padding: 0 13px !important;
      outline: 0;
    }
  }
  .el-submenu .el-menu {
    background-color: @sidebarSubMenuBackgroundColor !important;
  }
  .el-submenu .el-submenu__icon-arrow {
    color: inherit;
    right: 10px;
    // display: block;
    opacity: 1;
    transition: .3s opacity;
  }
  .el-submenu .el-menu-item {
    height: 30px;
    line-height: 30px;
    font-size: 14px;
    min-width: @sidebarItemWidth-lg !important;
    background-color: transparent !important;
    @media (max-width: 1400px) {
      min-width: @sidebarItemWidth-md !important;
    }
    &:hover {
      background-color: @sidebarItemhoverColor !important;
    }
    &.is-active {
      background-color: @sidebarItemActiveColor !important;
    }
  }
  .el-menu--collapse .el-menu .el-submenu {
    min-width: @sidebarWidth-lg !important;
    @media (max-width: 1400px) {
      min-width: @sidebarWidth-md !important;
    }
  }
  .el-menu-item, .el-submenu__title {
    height: 40px;
    line-height: 40px;
    padding: 0 13px !important;
    margin: 2px 10px;
    min-width: 40px;
    font-size: 16px;
    border-radius: 4px;
    transition: all .3s;
    &:hover {
      background-color: @sidebarItemhoverColor !important;
    }
    &.is-active {
      background-color: @sidebarItemActiveColor !important;
    }
  }
  .el-submenu.is-active {
    .el-submenu__title {
      background-color: @sidebarItemActiveColor !important;
    }
  }
  .horizontal-collapse-transition {
    width: auto !important;
  }
  .white {
    .sidebar-container {
      background-color: @sidebarWhiteThemeBackgroundColor;
      border-right: 1px solid #e6e6e6;
      .sidebar-logo-title {
        color: #000000;
      }
      .sidebarItem-groupTitle {
        color: #000000;
        margin: 12px 18px;
      }
    }
    .el-menu-item, .el-submenu__title {
      padding: 0 18px !important;
      margin: 0;
      border-radius: 0;
      color: @sidebarWhiteThemeItemColor;
      &:before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        border-left: 4px solid #1890ff;
        transform: scaleY(0.0001);
        opacity: 0;
        transition: transform 0.15s cubic-bezier(0.215, 0.61, 0.355, 1),
        opacity 0.15s cubic-bezier(0.215, 0.61, 0.355, 1);
      }
      &:hover {
        // color: @sidebarWhiteThemeItemhoverColor!important;
        background: @sidebarWhiteThemeBackgroundActiveColor !important;
      }
      &.is-active {
        background-color: @sidebarWhiteThemeBackgroundActiveColor !important;
      }
      &.is-active:before {
        transition: transform 0.15s cubic-bezier(0.645, 0.045, 0.355, 1),
        opacity 0.15s cubic-bezier(0.645, 0.045, 0.355, 1);
        opacity: 1;
        transform: scaleY(1);
      }
    }
    .el-menu-item {
      .el-tooltip {
        padding: 0 18px !important;
        outline: 0;
      }
    }
    .el-submenu .el-menu {
      background-color: @sidebarWhiteThemeSubMenuBackgroundColor !important;
    }
    .el-submenu.is-active {
      .el-submenu__title {
        color: @sidebarWhiteThemeItemhoverColor !important;
        background-color: @sidebarWhiteThemeBackgroundActiveColor !important;
      }
    }
    &.hideSidebar {
      .submenu-title-noDropdown {
        &:hover {
          span {
            box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
            right: @sidebarWhiteTooltipRight-lg;
            background-color: @sidebarWhiteThemeSubMenuBackgroundColor !important;
            @media (max-width: 1400px) {
              right: @sidebarWhiteTooltipRight-md;
            }
          }
        }
        &.is-active {
          span {
            color: @sidebarWhiteThemeItemhoverColor;
          }
        }
      }
      .el-submenu {
        & > .el-submenu__title {
          padding-left: 18px !important;
        }
      }
    }
  }
}
.el-menu--vertical {
  .el-menu-item, .el-submenu__title {
    height: 30px;
    line-height: 30px;
  }
}
.sidebarLink {
  color: inherit;
  text-decoration: none;
  display: block;
}
